home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
WINPROGS
/
UPC12BS1.ZIP
/
LIB
/
CONFIGUR.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-09-29
|
33KB
|
885 lines
/*--------------------------------------------------------------------*/
/* c o n f i g u r . c */
/* */
/* Support routines for UUPC/extended */
/* */
/* Changes Copyright 1990, 1991 (c) Andrew H. Derbyshire */
/* */
/* History: */
/* 21Nov1991 Break out of lib.c ahd */
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
/* Changes Copyright (c) 1989-1993 by Kendra Electronic */
/* Wonderworks. */
/* */
/* All rights reserved except those explicitly granted by the */
/* UUPC/extended license agreement. */
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
/* RCS Information */
/*--------------------------------------------------------------------*/
/*
* $Id: configur.c 1.22 1993/09/29 23:29:56 ahd Exp $
*
* Revision history:
* $Log: configur.c $
* Revision 1.22 1993/09/29 23:29:56 ahd
* Add xqtrootdir for UUXQT
*
* Revision 1.21 1993/09/29 04:49:20 ahd
* Move priority variables to modem file
*
* Revision 1.20 1993/09/24 03:43:27 ahd
* Use positive defaults for unsigned priority values
*
* Revision 1.19 1993/09/20 04:38:11 ahd
* TCP/IP support from Dave Watt
* 't' protocol support
* OS/2 2.x support
*
* Revision 1.18 1993/07/31 16:22:16 ahd
* Changes in support of Robert Denny's Windows 3.x support
*
* Revision 1.17 1993/07/22 23:19:50 ahd
* First pass for Robert Denny's Windows 3.x support changes
*
* Revision 1.16 1993/07/05 14:45:29 ahd
* Correct message-of-the-day variable name
* Correct WIN32 prefix support
*
* Revision 1.15 1993/06/16 04:03:25 ahd
* Special case root directories for UUPC/extended variable default
*
* Revision 1.14 1993/06/15 12:18:06 ahd
* Saved changed directory name for debugging
*
* Revision 1.13 1993/05/30 15:25:50 ahd
* Multiple driver support
*
* Revision 1.12 1993/05/29 15:19:59 ahd
* Add systems file, passwd files
*
* Revision 1.11 1993/05/09 03:49:21 ahd
* Support banner, motd strings
* Support longname, honordebug, senddebug options
*
* Revision 1.10 1993/04/15 03:17:21 ahd
* Add bounce system option
*
* Revision 1.9 1993/04/11 00:31:31 dmwatt
* Global edits for year, TEXT, etc.
*
* Revision 1.8 1993/04/05 04:32:19 ahd
* Set timezone, windows input mode in common routine
*
* Revision 1.7 1993/04/04 04:57:01 ahd
* Default configuration directory from UUPCSYSRC
* Default system directories from Configuration directory
*
* Revision 1.6 1993/03/06 22:48:23 ahd
* Don't fall off end of shorter tables
*
* Revision 1.5 1993/01/23 19:08:09 ahd
* Add Windows/NT to allowed environments
*
* Revision 1.4 1992/12/01 04:37:03 ahd
* Add SpeedOverMemory
*
* Revision 1.3 1992/11/22 20:58:55 ahd
* Normalize directories as read
* Use strpool to allocate const strings
*
* Revision 1.2 1992/11/19 02:56:47 ahd
* drop rcsid
*
* Revision 1.1 1992/11/16 05:00:26 ahd
* Initial revision
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <ctype.h>
#ifndef __GNUC__
#include <io.h>
#endif
/*--------------------------------------------------------------------*/
/* UUPC/extended include files */
/*--------------------------------------------------------------------*/
#include "lib.h"
#include "hlib.h"
#include "timestmp.h"
#include "pushpop.h"
/*--------------------------------------------------------------------*/
/* Global variables */
/*--------------------------------------------------------------------*/
currentfile();
boolean bflag[F_LAST]; /* Initialized to zero by compiler */
char **E_internal = NULL;
char *E_aliases = NULL;
char *E_altsignature = NULL;
char *E_anonymous = NULL;
char *E_archivedir = NULL;
char *E_backup = NULL;
char *E_banner = NULL;
char *E_charset = NULL;
char *E_passwd = NULL;
char *E_systems = NULL;
char *E_confdir = NULL;
char *E_domain = NULL;
char *E_editor = NULL;
char *E_fdomain = NULL;
char *E_filesent = NULL;
char *E_homedir = NULL;
char *E_inmodem = NULL;
char *E_localdomain = NULL;
char *E_mailbox = NULL;
char *E_maildir = NULL;
char *E_mailext = NULL;
char *E_mailserv = NULL;
char *E_motd = NULL;
char *E_name = NULL;
char *E_newsdir = NULL;
char *E_newsserv = NULL;
char *E_nodename = NULL;
char *E_organization = NULL;
char *E_pager = NULL;
char *E_postmaster = NULL;
char *E_pubdir = NULL;
char *E_replyto = NULL;
char *E_signature = NULL;
char *E_spooldir = NULL;
char *E_tempdir = NULL;
char *E_uncompress = NULL;
char *E_uuxqtpath = NULL;
char *E_version = NULL;
char *E_cwd = NULL;
char *E_xqtRootDir = NULL;
KEWSHORT E_maxhops = 20; /* ahd */
static char *dummy = NULL;
static char *E_tz = NULL;
/*--------------------------------------------------------------------*/
/* Local emumerated types */
/*--------------------------------------------------------------------*/
typedef enum {
ENV_UNKNOWN = 0x0001,
ENV_DOS = 0x0002,
ENV_BIT32 = 0x0004,
ENV_BIT16 = 0x0008,
ENV_OS2 = 0x0010,
ENV_OS2_32BIT = 0x0020,
ENV_OS2_16BIT = 0x0040,
ENV_WIN = 0x0080,
ENV_WIN_32BIT = 0x0100,
ENV_WIN_16BIT = 0x0200
} ENV_TYPE;
#ifdef WIN32
static ENV_TYPE active_env = ENV_WIN_32BIT | ENV_WIN | ENV_BIT32;
#elif defined(_Windows)
static ENV_TYPE active_env = ENV_WIN_16BIT | ENV_WIN | ENV_BIT16;
#elif defined(__OS2__)
static ENV_TYPE active_env = ENV_OS2_32BIT | ENV_OS2 | ENV_BIT32;
#else
static ENV_TYPE active_env = ENV_DOS | ENV_BIT16;
#endif
static boolean getrcnames(char **sysp,char **usrp);
/*--------------------------------------------------------------------*/
/* The following table controls the configuration files processing */
/*--------------------------------------------------------------------*/
static CONFIGTABLE envtable[] = {
{"aliases", &E_aliases, B_TOKEN|B_MUA},
{"altsignature", &E_altsignature, B_TOKEN|B_MUA},
{"anonymouslogin", &E_anonymous, B_GLOBAL|B_TOKEN|(B_ALL & ~ B_MAIL)},
{"archivedir", &E_archivedir, B_GLOBAL|B_PATH|B_ALL},
{"backupext", &E_backup, B_TOKEN|B_MUA},
{"banner", &E_banner, B_GLOBAL|B_PATH|B_UUCICO},
{"charset", &E_charset, B_TOKEN|B_GLOBAL|B_SPOOL},
{"confdir", &E_confdir, B_GLOBAL|B_PATH|B_ALL},
{"domain", &E_domain, B_REQUIRED|B_GLOBAL|B_TOKEN|B_ALL},
{"editor", &E_editor, B_STRING|B_MUA|B_NEWS},
{"filesent", &E_filesent, B_TOKEN|B_MUA|B_NEWS},
{"folders", &dummy, B_PATH|B_MUSH },
{"fromdomain", &E_fdomain, B_GLOBAL|B_MAIL|B_NEWS|B_TOKEN},
{"home", &E_homedir, B_PATH|B_REQUIRED|B_ALL},
{"inmodem", &E_inmodem, B_GLOBAL|B_TOKEN|B_UUCICO},
{"internalcommands", (char **) &E_internal, B_GLOBAL|B_LIST|B_ALL},
{"localdomain", &E_localdomain, B_GLOBAL|B_TOKE